var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return
    }(mode == 1) ? status++ : status--;
    selectionLog[status] = selection;
    var i = -1;
    if (status <= i++) {
        cm.dispose()
    } else {
        if (status === i++) {
            cm.askMenu("你好！你有什么事情吗？\r\n\r\n#b#L0# 我想在逆转法典上注入反魔力。#l\r\n#L1# 我想把搜集的反魔力和反魔力石交换成#t4310092#或#t4310091#。#l", 0, 2230205)
        } else {
            var reactor = "action分支" + selectionLog[1];
            eval(reactor)(mode, type, selection, i)
        }
    }
}

function action分支0(d, c, b, a) {
    if (status <= a++) {
        cm.sendNormalTalk("哎？你好像没有装备逆转法典哦！只有装备好后才能注入反魔力，请重新确认一下是否已经装备上。", 0, 2230205, false, false)
    } else {
        if (status === a++) {
            cm.dispose()
        }
    }
}

function action分支1(d, c, b, a) {
    if (status <= a++) {
        cm.sendNormalTalk("你好像没有可以用来交换的反魔力或反魔力石……#b想交换#t4310091##k的话，#r每个需要反魔力 700#k。#b交换#t4310092##k的话，#r每个需要反魔力石1个和反魔力 1200#k。你能确认一下吗？", 0, 2230205, false, false)
    } else {
        if (status === a++) {
            cm.dispose()
        }
    }
};